package com.example.testsvgavip;

import com.larvalabs.svgandroid.SVG;
import com.larvalabs.svgandroid.SVGParser;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ImageView;


public class DisplaySVG extends Activity
{
		@Override
		public void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			//setContentView(R.layout.activity_main);
			
			// Create a new ImageView
	        ImageView imageView = new ImageView(this);
	        // Set the background color to white
	        imageView.setBackgroundColor(Color.WHITE);
			
	        //Parse the SVG file from the resource
	        SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.android_svg);
	       //SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.map);
	        // Get a drawable from the parsed SVG and set it as the drawable for the ImageView
	        imageView.setImageDrawable(svg.createPictureDrawable());
	        // Set the ImageView as the content view for the Activity
	        setContentView(imageView);
			/*
			WebView mainWebView = (WebView) findViewById(R.id.mainWebView);
	        
	        WebSettings webSettings = mainWebView.getSettings();
	        webSettings.setJavaScriptEnabled(true);
	        
	        mainWebView.setWebViewClient(new MyCustomWebViewClient());
	        mainWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
	        
	        mainWebView.loadUrl("https://upload.wikimedia.org/wikipedia/commons/1/17/Gardens_OSM_map.svg");
	       	//mainWebView.loadUrl("http://www.idact.eu/");
	        
	        */
		}

		@Override
		public boolean onCreateOptionsMenu(Menu menu) {
			// Inflate the menu; this adds items to the action bar if it is present.
			getMenuInflater().inflate(R.menu.activity_main, menu);
			return true;
		}
}
